package com.hexus.eve.application;

import org.springframework.web.context.WebApplicationContext;

@SuppressWarnings("rawtypes")
public class BeanFactory {
	static private WebApplicationContext applicationContext = null;
	
	static public WebApplicationContext getApplicationContext() {
		return applicationContext;
	}
	
	static public void setApplicationContext(WebApplicationContext context) {
		applicationContext = context;
	}
	
	@SuppressWarnings("unchecked")
	static public Object getBean(Class c) {		
		return applicationContext == null ? null : applicationContext.getBean(c);
	}
	
	static public Object getBean(String className) {
		return applicationContext == null ? null : applicationContext.getBean(className);
	}
}
